package de.jamm.gui;
import java.applet.*;
import java.net.*;

public class Sound {
 
    private AudioClip song; // Sound player
    private URL songPath; // Sound path
 
    public Sound(final String filename) {
        songPath = getClass().getResource(filename); // Get the Sound URL
        song = Applet.newAudioClip(songPath); // Load the Sound
    }
 
    public void playSound() {
        song.loop(); // Play
    }
 
    public void stopSound() {
        song.stop(); // Stop
    }
 
    public void playSoundOnce() {
        song.play(); // Play only once
    }
}